pulse-dashboard
Version:
A Next.js Dashboard application for real-time monitoring and historical analysis of Playwright test executions, based on playwright-pulse-report. This component provides the UI for visualizing Playwright test results and can be run as a standalone CLI too
4 lines (3 loc) • 5.78 kB
JavaScript
module.exports=[24868,(a,b,c)=>{b.exports=a.x("fs/promises",()=>require("fs/promises"))},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},22918,a=>{"use strict";var b=a.i(37936),c=a.i(24868),d=a.i(14747);async function e(){let a=process.env.PULSE_USER_CWD,b=process.env.PULSE_REPORT_DIR,e=process.cwd(),f=a&&""!==a.trim()?a.trim():e,g=b&&""!==b.trim()?b.trim():d.default.join(f,"pulse-report"),h=d.default.join(g,"playwright-pulse-report.json");try{let a=await c.default.readFile(h,"utf-8");return JSON.parse(a)}catch(a){return console.error("[ACTIONS getCurrentRunReport] Error reading current run report:",a),null}}async function f(){console.log("[ACTIONS getRawHistoricalReports] ------------- START -------------");let a=process.env.PULSE_USER_CWD,b=process.env.PULSE_REPORT_DIR,e=process.cwd();console.log("[ACTIONS getRawHistoricalReports] process.env.PULSE_USER_CWD:",a),console.log("[ACTIONS getRawHistoricalReports] process.env.PULSE_REPORT_DIR:",b),console.log("[ACTIONS getRawHistoricalReports] process.cwd():",e);let f=a&&""!==a.trim()?a.trim():e,g=b&&""!==b.trim()?b.trim():d.default.join(f,"pulse-report");console.log("[ACTIONS getRawHistoricalReports] Effective baseDir determined:",f),console.log("[ACTIONS getRawHistoricalReports] Effective reportDir determined:",g);let h=d.default.join(g,"history");console.log("[ACTIONS getRawHistoricalReports] Attempting to read history directory:",h);try{let a=(await c.default.readdir(h)).filter(a=>a.startsWith("trend-")&&a.endsWith(".json"));console.log(`[ACTIONS getRawHistoricalReports] Found ${a.length} trend files in ${h}`);let b=[];for(let e of a){let a=d.default.join(h,e);try{let d=await c.default.readFile(a,"utf-8"),f=JSON.parse(d);f.run&&f.results?(void 0===f.run.flakinessRate&&(f.run.flakinessRate=0),b.push(f)):console.warn(`[ACTIONS getRawHistoricalReports] Skipping invalid historical report file (missing run or results): ${e}`)}catch(a){console.error(`[ACTIONS getRawHistoricalReports] Error reading or parsing historical file ${e}:`,a)}}return b.sort((a,b)=>new Date(a.run.timestamp).getTime()-new Date(b.run.timestamp).getTime()),console.log("[ACTIONS getRawHistoricalReports] ------------- END (SUCCESS) -------------"),b}catch(a){return console.error(`[ACTIONS getRawHistoricalReports] Error accessing or reading historical trends directory ${h}:`,a.message),a instanceof Error&&"ENOENT"===a.code&&console.warn(`[ACTIONS getRawHistoricalReports] History directory not found at ${h}. This is normal if no historical reports exist yet.`),console.log("[ACTIONS getRawHistoricalReports] ------------- END (ERROR) -------------"),[]}}async function g(){try{let a=await e(),b=await f(),c=[];if(a?.results&&a.results.forEach(b=>{var d;"flaky"===(d=b,"flaky"===d.outcome||"flaky"===d.status||"passed"===d.status&&d.retryHistory&&d.retryHistory.length>0&&d.retryHistory.some(a=>"failed"===a.status||"timedOut"===a.status)?"flaky":d.retryHistory&&d.retryHistory.length>0&&d.final_status&&"flaky"===d.final_status?"flaky":d.status)&&c.push({id:b.id,name:b.name,suiteName:b.suiteName,occurrences:[{runTimestamp:a.run.timestamp,status:"flaky"}],passedCount:1,failedCount:0,skippedCount:0,pendingCount:0,totalRuns:1,firstSeen:a.run.timestamp,lastSeen:a.run.timestamp})}),0===b.length)return{success:!0,currentFlakyTests:c,historicalFlakyTests:[]};let d=new Map;for(let a of b)if(a.results)for(let b of a.results)d.has(b.id)||d.set(b.id,{name:b.name,suiteName:b.suiteName,occurrences:[]}),d.get(b.id).occurrences.push({runTimestamp:a.run.timestamp,status:b.status});let g=[];for(let[a,b]of d.entries()){let c=new Set(b.occurrences.map(a=>a.status)),d=c.has("passed"),e=c.has("failed")||c.has("timedOut");if(d&&e){let c=0,d=0,e=0,f=0;b.occurrences.forEach(a=>{"passed"===a.status?c++:"failed"===a.status||"timedOut"===a.status?d++:"skipped"===a.status?e++:"pending"===a.status&&f++});let h=b.occurrences.sort((a,b)=>new Date(a.runTimestamp).getTime()-new Date(b.runTimestamp).getTime());g.push({id:a,name:b.name,suiteName:b.suiteName,occurrences:h,passedCount:c,failedCount:d,skippedCount:e,pendingCount:f,totalRuns:b.occurrences.length,firstSeen:h[0]?.runTimestamp||"",lastSeen:h[h.length-1]?.runTimestamp||""})}}return g.sort((a,b)=>b.failedCount/b.totalRuns-a.failedCount/a.totalRuns||b.totalRuns-a.totalRuns),{success:!0,currentFlakyTests:c,historicalFlakyTests:g}}catch(a){return console.error("[ACTIONS getFlakyTestsAnalysis] Error analyzing flaky tests:",a),{success:!1,error:a instanceof Error?a.message:"An unknown error occurred during flaky test analysis."}}}(0,a.i(13095).ensureServerEntryExports)([e,f,g]),(0,b.registerServerReference)(e,"00dd6c8eacb439c0c4bd7a4bc356a97120ba631362",null),(0,b.registerServerReference)(f,"00c486baa1611458e5a49e3f6a5b624cc5a450103d",null),(0,b.registerServerReference)(g,"0009e5f2f02111be8b23328e5713eb34687e624ccf",null),a.s(["getFlakyTestsAnalysis",0,g,"getRawHistoricalReports",0,f],22918)},32989,a=>{"use strict";var b=a.i(22918);a.s([],11893),a.i(11893),a.s(["0009e5f2f02111be8b23328e5713eb34687e624ccf",()=>b.getFlakyTestsAnalysis],32989)}];
//# sourceMappingURL=%5Broot-of-the-server%5D__0uyy96m._.js.map